/*
 * author      : 吴中勤 
 * date        : 2018/8/16
 * description : moby事件分发, 此controller进行接收处理
 */

package com.deepexi.adapter.rest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;

@Controller
@RequestMapping(value = "/api/v1/ruok")
public class HealthzController {
    private static final Logger logger = LoggerFactory.getLogger(HealthzController.class);

    @PostConstruct
    public void todo() {
        logger.info("load controller {}", this.getClass().getSimpleName());
    }

    /**
     * 测试接口
     * http://localhost:8001/adapter/api/v1/ruok
     * http://moby.xbotech.com/moby-mall/adapter/api/v1/ruok
     */
    @ResponseBody
    @RequestMapping(value = {"/", ""}, method = {RequestMethod.GET})
    public String test1() {
        return "imok";
    }
}
